﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UniMana.Utils.Helper
{
    public static class String
    {
        public static string GetRtfUnicodeEscapedString(string s)
        {
            var sb = new StringBuilder();
            foreach (var c in s)
            {
                if (c <= 0x7f)
                    sb.Append(c);
                else
                    sb.Append("\\u" + Convert.ToUInt64(c) + "?");
            }
            return sb.ToString();
        }
        public static string RandomString(int _inumberChar = 6)
        {
            string result = "";
            Random rand = new Random();
            for (int i = 0; i < _inumberChar; i++)
            {
                result += (char)rand.Next(33, 126);
            }
            return result;
        }
    }
}
